#_*_ encoding:utf-8 _*_
from .models import LogInfo

def genlog(request,operate_type,content):
    if request.META.has_key('HTTP_X_FORWARDED_FOR'):
        ip =  request.META['HTTP_X_FORWARDED_FOR']
    else:
        ip = request.META['REMOTE_ADDR']
	LogInfo.objects.create(user=request.user,operate_type=operate_type,operate_ip=ip,content=content)